package com.sne.airways.system.dao.impl;

import com.sne.airways.basecore.dao.impl.BaseDAOHibernate;
import com.sne.airways.system.dao.SystemPropertiesDAO;
import com.sne.airways.system.pojo.SystemProperties;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: skyline
 * Date: 12-9-26
 * Time: 下午2:30
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class SystemPropertiesDAOHibernate extends BaseDAOHibernate implements SystemPropertiesDAO {

    /**
     * 获取所有系统属性列表
     *
     * @return
     */
    @Override
    public List<SystemProperties> queryAllSystemPropertiesList() {
        Session session = getSession();
        StringBuffer sb = new StringBuffer();
        sb.append(" select op from SystemProperties op ");
        Query query=session.createQuery(sb.toString());
        return  query.list();
    }
}
